package com.jingtai.common.utils;

import java.util.function.Supplier;

/**
 * Description: 自定义工具类封装了BeanUtils
 * Create DateTime: 2020/5/12 14:02
 *
 * @author huangzi
 */
public class MyBeanUtils extends org.springframework.beans.BeanUtils {
    public static <T> T copyPropertiesChaining(Object source, T target) {
        org.springframework.beans.BeanUtils.copyProperties(source, target);
        return target;
    }

    public static <T> T copyPropertiesChaining(Object source, Supplier<T> supplier) {
        return copyPropertiesChaining(source, supplier.get());
    }
}
